Simplify NewType handling in relation.rs#24109
Merged
AlexWaygood merged 1 commit intomainfrom Mar 23, 2026
Merged
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 85.38%. The percentage of expected errors that received a diagnostic held steady at 78.70%. The number of fully passing files held steady at 64/132. |
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-await |
0 | 40 | 0 |
invalid-return-type |
0 | 1 | 0 |
| Total | 0 | 41 | 0 |
Changes in flaky projects detected. Raw diff output excludes flaky projects; see the HTML report for details.
b95484f to
5cdd2cf
Compare
5cdd2cf to
c7d8798
Compare
a702e2d to
2c49c6e
Compare
fix regression
c7d8798 to
3db2760
Compare
carljm
added a commit
that referenced
this pull request
Mar 25, 2026
* main: (36 commits) [ty] Reduce diagnostic range for `invalid-metaclass` (#24145) [ty] Simplify TypeVar assignability/subtyping logic (#24138) [ty] Prevent tainted loop bindings in cycle normalization (#24143) [ty] Add precisely-typed overloads for `TypedDict` update (#24101) [ty] Fix folding ranges of comments separated by statements (#24132) Bump ecosystem-analyzer pin (#24136) Bump ecosystem-analyzer pin (#24135) Simplify `NewType` handling in `relation.rs` (#24109) [ty] Add more tests for `NewType` subtyping (#24115) [ty] Add `NewType`s to the property tests (#24113) [ty] Prepare test files for unreachable code change (#24133) `analyze graph`: resolve string imports that reference attributes, not just modules (#24058) Update Artifact GitHub Actions dependencies (#24116) Update taiki-e/install-action action to v2.68.33 (#24130) Update taiki-e/install-action action to v2.68.32 (#24123) Update Rust crate serde_with to v3.18.0 (#24126) Update Swatinem/rust-cache action to v2.9.1 (#24127) Update Rust crate quick-junit to 0.6.0 (#24125) Update Rust crate clap to v4.6.0 (#24124) Update Rust crate tracing-subscriber to v0.3.23 (#24122) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
We currently have two dedicated branches in the big
has_relation_tomatchthat are both only there to handle the special case ofNewTypes of unions. I believe we can simplify the code a fair bit by consolidating both special cases into the(_, Type::Union(...))branch of thematch.Test Plan
Existing tests all pass. This branch is based on top of #24113 and #24115, which together improve our
NewTypetest coverage a fair bit.